﻿using SmartRS.com.vn.smartrs.domain;
using SmartRS.com.vn.smartrs.dao;
using SmartRS.com.vn.smartrs.interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartRS.com.vn.smartrs.service
{
    public class BaseService<T> : BaseDbInterface<T> where T : BaseDomain
    {

        public T insert(T obj)
        {
            return new BaseDao<T>().insert(obj);
        }

        public bool update(T obj)
        {
            return new BaseDao<T>().update(obj);
        }

        public bool delete(T obj)
        {
            return new BaseDao<T>().delete(obj);
        }

        public T getById(long id)
        {
            return new BaseDao<T>().getById(id);
        }

        public IList<T> getAll()
        {
            return new BaseDao<T>().getAll();
        }
    }
}
